# -*- coding: utf-8 -*- 
# @project : 《Atcoder》
# @Author : created by bensonrachel on 2021/8/11
# @File : TPM（step1）B. Number of Smaller.py


def TPM():
    char = []
    cnt = 0
    while (rate_a and rate_b):
        if (rate_a[0] < rate_b[0]):# 这里是小于号
            tmp = rate_a.pop(0)
            cnt += 1 # 记录一下弹出了几个即可
        else:
            # 遇到rate_a[0] >= rate_b[0]的
            tmp = rate_b.pop(0)
            char.append(cnt)#就把cnt输入记录数组
    if (rate_b):# 如果数组一遍历完，对于数组二剩下的数跟退出while的数组二遍历到的那个数，他们的答案是一样
        for i in rate_b:
            char.append(n)

    return char

"""
数一下数组二中的每个值在数组一中有多少个比它小的记录下来
"""
if __name__ == "__main__":
    n, m = map(int, input().split())
    rate_a = [int(i) for i in input().split()]
    rate_b = [int(i) for i in input().split()]
    res = TPM()
    for i in res:
        print(i, end=' ')


